<template>
	<view class="list padding-bj bg-white margin-bottom-sm">
		<view class="userinfo flex justify-between align-center" v-if="item.user">
			<view class="avatar flex justify-start align-center">
				<view class="cu-avatar round margin-right-xs"
					:style="{ backgroundImage: 'url(' + $wanlshop.oss(item.user.avatar, 35, 35, 2, 'avatar') + ')' }">
				</view>
				<view class="text-sm">
					<view>{{ item.user.nickname }}</view>
					<view class="text-gray">{{ $wanlshop.timeToDate(item.createtime) }}</view>
				</view>
			</view>
			<wanl-rate :current="item.score" :disabled="true" />
		</view>
		<view class="details">
			<view class="margin-tb-sm">{{ item.content || '没有评价内容~'}}</view>
			<!-- <view class="text-gray text-sm" v-if="navList[tabCurrentIndex].statue == 7 || navList[tabCurrentIndex].statue == 8">规格：{{ item.source_id_text }}</view> -->
		</view>
		
		<view class="flex-sub flex justify-start align-center" v-if="item.images_text">
			<view class="bg-img" v-for="(image, index) in item.images_text" :key="index"
				@tap="previewImage(item.images_text, index)"
				:style="{ backgroundImage: 'url(' + $wanlshop.oss(image, 248, 0) + ')' }"></view>
		</view>
		<view class="goods margin-top-sm" @tap="handleGoods(item)" v-if="item.servesinfo">
			<view class="cu-avatar"
				:style="{ backgroundImage: 'url(' + $wanlshop.oss(item.servesinfo.image, 66,66) + ')' }">
			</view>
			<view class="content margin-left-bj">
				<view class="text-cut margin-bottom-xs">
					{{ item.servesinfo.title || item.servesinfo.name }}
				</view>
				<view class="text-min">{{item.difference || item.type_text}}</view>
			</view>
		</view>
	</view>
</template>


<script>
	export default {
		props:{
			item: {
				type: Object,
				default() {
					return {};
				}
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			
			handleGoods(item){
				this.$wanlshop.to(`/pages/medicalcare/homemaking/product?id=${item.goods_id}`)
			},
			
			//预览图片
			previewImage(image, index) {
				var imgArr = [];
				for (var item of image) {
					imgArr = imgArr.concat(this.$wanlshop.oss(item, 500));
				}
				uni.previewImage({
					urls: imgArr,
					current: imgArr[index],
					indicator: 'number'
				});
			}
		}
	}
</script>

<style scoped>
	
	
	.bg-img {
		width: 100rpx;
		height: 100rpx;
		margin-right: 16rpx;
	}
</style>